import java.util.Scanner;

//判断是否为回文字符串
public class Demo3 {
    public static boolean isLegal(char ch){
            if(ch >= 'A' && ch <= 'Z'||ch >= 'a' && ch<= 'z'){
                return true;
            }

        return false;
    }
    public static boolean func1(String s){
        int left = 0;
        int right = s.length()-1;
        for (int i = 0; i < s.length() ; i++) {
            while(left<right){
            while (left < right&& isLegal(s.charAt(left))==false){
                left++;
            }
            while (left < right&& isLegal(s.charAt(right))==false) {
                right--;
            }
            if (s.charAt(left)==s.charAt(right)){
                left++;
                right--;
            }
            else {
                return false;
              }
            }
        }
        return true;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        System.out.println(func1(s));
    }
}
